@extends('layouts.template')

@section('title', '管理后台')

@section('content')

    <script>
        $(function(){

            var form = new Vue({
                el:'#contentpanel',
                data:{
                },
                computed:{
                },
                mounted:function(){
                },
                watch: {
                },
                methods:{
                },
                components:{
                }
            });
        });

    </script>

    <div class="panel-body">
        <div class="panel panel-default">
            <div class="panel-body">
                <form action="" method="GET" class="form-inline">
                    <div>
                        {!! $filter !!}
                    </div>
                </form>
            </div>
        </div>
    </div>

    <div class="contentpanel" id="contentpanel">

        <div class="row">
            <div class="col-md-12">
                <div class="table-responsive">
                    <table class="table mb30">
                        <thead>
                        <tr style="white-space:nowrap">
                            <th><input type="checkbox" onclick="checkall(this)">选择</th>
                            <th>手机号</th>
                            <th>发送时间</th>
                            <th>发送内容</th>
                            <th>发送结果码</th>
                            <th>错误信息</th>
                        </tr>
                        </thead>
                        <tbody>
                        <?php foreach ($list as $row):?>
                            <tr data-id="{{$row->id}}">
                                <td><input type="checkbox" value="{{$row->id}}" name="user[]"></td>
                                <td>{{$row->sl_phone}}</td>
                                <td>{{$row->sl_add_time}}</td>
                                <td>{{$row->sl_content}}</td>
                                <td>{{$row->sl_code}}</td>
                                <td>{{$row->sl_error}}</td>
                            </tr>
                        <?php endforeach;?>
                        </tbody>
                    </table>
                </div>
                <!-- table-responsive -->
                {{ @!$list->isEmpty() ? $list->appends(request()->all())->links() : '' }}
            </div>
            <!-- col-md-12 -->
        </div>
    </div><!-- contentpanel -->

    <div class="modal fade" id="add" tabindex="-1" role="dialog" data-keyboard="false">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title">新建管理员</h4>
                </div>
                <form id="add-form" method="post" action="{{url("admin/add")}}">
                    {{csrf_field()}}
                    <div class="modal-body">
                        <div class="form-group">
                            <input type="text" class="form-control" name="name" placeholder="用户名">
                        </div>
                        <div class="form-group">
                            <input type="email" class="form-control" name="email" placeholder="邮箱地址">
                        </div>
                        <div class="form-group">
                            <input type="password" class="form-control" name="password" placeholder="密码">
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                        <button type="submit" class="btn btn-primary">创建</button>
                    </div>
                </form>
            </div>
        </div>
    </div>

    <div class="modal fade" id="edit" tabindex="-1" role="dialog" data-keyboard="false">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title">编辑</h4>
                </div>
                <form id="edit-form" method="post" action="{{url("admin/edit")}}">
                    {{csrf_field()}}
                    <input type="hidden" name="manager_id">
                    <div class="modal-body">
                        <div class="form-group">
                            <input type="text" class="form-control" name="name" placeholder="用户名">
                        </div>
                        <div class="form-group">
                            <input type="email" class="form-control" name="email" placeholder="邮箱地址">
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                        <button type="submit" class="btn btn-primary">修改</button>
                    </div>
                </form>
            </div>
        </div>
    </div>

    <div class="modal fade" id="editPass" tabindex="-1" role="dialog" data-keyboard="false">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title">修改密码</h4>
                </div>
                <form id="editPass-form" method="post" action="{{url("admin/editpass")}}">
                    {{csrf_field()}}
                    <input type="hidden" name="manager_id">
                    <div class="modal-body">
                            <div class="form-group">
                                <input type="password" class="form-control" name="password" placeholder="新密码">
                            </div>
                            <div class="form-group">
                                <input type="password" class="form-control" name="password_confirmation" placeholder="重复密码">
                            </div>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                        <button type="submit" class="btn btn-primary">修改</button>
                    </div>
                </form>
            </div>
        </div>
    </div>

@endsection

